home *** CD-ROM | disk | FTP | other *** search
- Path: news.lpr.carel.fi!usenet
- From: aril@cmt.lpr.mail.carel.fi (Ari Lukumies)
- Newsgroups: comp.lang.c++
- Subject: Re: assembly lang. and Borland C++
- Date: Mon, 15 Jan 1996 10:31:43 GMT
- Organization: Carelcomp Forest Oy
- Message-ID: <4ddas3$di6@tahko.lpr.carel.fi>
- References: <4d5q0m$926@news.rwth-aachen.de>
- NNTP-Posting-Host: renoir.cclahti.carel.fi
- X-Newsreader: Forte Free Agent 1.0.82
-
- ILT-Benutzer <user@ilt.fhg.de> wrote:
-
- [stuff deleted]
- >But I need the opposite of this. The assembly language module shall
- >call a C++routine.
-
- >I tried the following:
-
- >C++ Modul:
- >--------------------------------------
- >..
- >void CProzedur()
- >{
- > ...
- >}
- >..
- >--------------------------------------
-
- >and in assembymodul:
- >--------------------------------------
- >..
- >extrn _CProzedur:far
- >..
- >..
- >call _CProzedur ; call the CRoutine
- >--------------------------------------
-
- >If I compile it as C (C-module has extension .C) code no error appears.
- >But if I switch the key Options|compiler|C++options to
- >CPP always the Linker says something like:
- >Can┤t find _CProzedur ...
-
- >So, I have to tell the assembler that it has to generate C++ Code.
- >But how ???
-
- When you compile CPP code, the compiler mangles the function names (it
- will attach runtime type information to the function name, such as the
- return type and types of parameters). So, the name will not look like
- you'd expect to your assembly code. For instance, if you have a class
- CBase with a default constructor:
-
- CBase::CBase() { }
-
- the name that the compiler will give to compiled function will be
- something like:
-
- ??0CBase@@REC@XZ
-
- So, in order to call the function from assembly code, you'll need to
- find out how your C++ compiler generates those mangled (or decorated,
- if you'd prefer) names. This information is usually included with your
- compiler's documentation.
-
- Later,
- AriL
-
- All my opinions are mine and mine alone.
-
-